<?php
	class Connection{
		var $servername = "";
		var $username = "";
		var $password = "";
		var $database = "";
		var $con;
		
		function Connection($servername, $database, $username, $password)
		{
			$this->servername = $servername;
			$this->database = $database;
			$this->username = $username;
			$this->password = $password;
			
			$this->con = mysql_connect($this->servername, $this->username, $this->password);
			if(!$this->con){
				exit("Could not connect: " . mysql_error());
			}
			else
			{
				mysql_select_db($this->database, $this->con);
                mysql_query("SET NAMES 'utf8'");
			}
		}
		
		function ExecuteQuery($query)
		{
			return mysql_query($query, $this->con);
		}
	}
?>